package sz.szsmk.citizencard.ui.adapter;

import android.content.Context;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.databinding.AllSerViewBinding;

/**
 * Copyright (c)2018
 * author: zdh
 * created on: 2018/7/12 15:02
 * description:
 */
public class AllServiceAdapter extends RecyclerView.Adapter<AllServiceAdapter.AllSerHolder> {

    private Context mContext;

    public AllServiceAdapter(Context context) {
        mContext = context;
    }

    @Override
    public int getItemViewType(int position) {
        return R.layout.all_ser_view;
    }

    @Override
    public AllSerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return AllSerHolder.creat(parent);
    }

    @Override
    public void onBindViewHolder(AllSerHolder holder, int position) {
        loadItemData(position, holder.binding);
    }

    private void loadItemData(int position, AllSerViewBinding binding) {

    }

    @Override
    public int getItemCount() {
        return 3;
    }

    public static class AllSerHolder extends RecyclerView.ViewHolder {

        private AllSerViewBinding binding;

        public static AllSerHolder creat(ViewGroup parent) {
            AllSerViewBinding binding = AllSerViewBinding
                    .inflate(LayoutInflater.from(parent.getContext()), parent, false);
            return new AllSerHolder(binding);

        }

        public AllSerHolder(AllSerViewBinding binding) {
            super(binding.getRoot());
            this.binding = binding;
        }
    }
}
